package com.spotmanger.project.modular.spottable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spotmanger.project.modular.spottable.entity.SpottableProductivemineNewEntity;
import com.spotmanger.project.modular.spottable.mapper.SpottableProductivemineNewMapper;
import com.spotmanger.project.modular.spottable.service.SpottableProductivemineNewService;
import org.springframework.stereotype.Service;


@Service("spottableProductivemineNewService")
public class SpottableProductivemineNewServiceImpl extends ServiceImpl<SpottableProductivemineNewMapper, SpottableProductivemineNewEntity> implements SpottableProductivemineNewService {
    /**
     * 以TBBH为主,结合 LambdaQueryWrapper的模糊搜索方法。
     */
    @Override
    public LambdaQueryWrapper<SpottableProductivemineNewEntity> searchByTBBH(SpottableProductivemineNewEntity spottableProductivemineNew){
        LambdaQueryWrapper<SpottableProductivemineNewEntity> queryWrapper = Wrappers.lambdaQuery();
        if(spottableProductivemineNew.getTBBH()!=null){
            queryWrapper.like(SpottableProductivemineNewEntity::getTBBH,spottableProductivemineNew.getTBBH());
        }else {
            return queryWrapper;
        }
        return queryWrapper;
    }

}
